package com.minhua.jijiehao2.mainframe.launcher.registeractivity.impl

import com.minhua.jijiehao2.bean.BaseBean
import com.minhua.jijiehao2.bean.CheckCodeBean
import com.minhua.jijiehao2.http.*
import com.minhua.jijiehao2.mainframe.launcher.registeractivity.imp.IRegisterModel

class RegisterModel : IRegisterModel {

    override fun sendCode(map: ParamsMap, callBack: CallBack<CheckCodeBean>) {
        HttpController<CheckCodeBean>().doHttp(
                ApiClient.getInstance().api.getCode(map.toRequestBody()),
                object : BaseSubscriber<CheckCodeBean>() {
                    override fun dealData(t: BaseBean<CheckCodeBean>) {
                        super.dealData(t)
                        callBack.onSuccess(t)
                    }
                }
        )
    }
}